
package poker.plans.player;

import jadex.runtime.IMessageEvent;
import jadex.runtime.Plan;

import poker.beliefs.GameResult;
import poker.beliefs.Hand;
import poker.util.HandChecker;

public class LoserPlan extends Plan {

	@Override
	public void body() {
		//Get the message
		IMessageEvent notify = (IMessageEvent)getInitialEvent();
		
		//Reset some beliefs
		getBeliefbase().getBelief("hand").setFact(new Hand());
		getBeliefbase().getBelief("mypot").setFact(new Integer(0));
		getBeliefbase().getBelief("blind").setFact(new Integer(0));
		
		//Do something with the winner info
		GameResult result = (GameResult)notify.getContent();
		System.out.println("PLAYER " + getAgentName() + ": Notification received, winner/s " + result.getWinners() + " with a hand rank of " + HandChecker.rankHand(result.getWinnerHand()));
		
	}

}
